import { formatTimestamp } from '@/utils/format'
import { formatMoney } from '@/utils/util'

export const FILTER_PARAMS = [
  {
    placeholder: '姓名',
    name: 'name'
  },
  {
    placeholder: '身份证号',
    name: 'idcardNum'
  },
  {
    placeholder: '企业名称',
    name: 'enterpriseName'
  },
  {
    placeholder: '项目名称',
    name: 'projectName'
  },
  {
    placeholder: ['开始日期', '结束日期'],
    type: 'a-range-picker',
    name: 'timeRange',
    customProps: {
      valueFormat: 'YYYY-MM-DD'
    },
    wrapperCol: {
      md: 5,
      sm: 10
    }
  }
]

export const BILL_LIST_COLUMNS = [
  {
    title: 'ID',
    dataIndex: 'batchId',
    fixed: 'left'
  },
  {
    title: '企业名称',
    dataIndex: 'enterpriseName'
  },
  {
    title: '项目名称',
    dataIndex: 'projectName'
  },
  {
    title: '姓名',
    dataIndex: 'name'
  },
  {
    title: '手机号',
    dataIndex: 'phone'
  },
  {
    title: '身份证号',
    dataIndex: 'idcardNum',
    sorter: true
  },
  {
    title: '开户行',
    dataIndex: 'bankName'
  },
  {
    title: '银行卡号',
    dataIndex: 'bankCardNum'
  },
  {
    title: '众包费',
    dataIndex: 'salaryFee',
    customRender: (afterFee) => formatMoney(afterFee),
    customExportRender: (afterFee) => formatMoney(afterFee).substring(2)
  },
  {
    title: '支付时间',
    dataIndex: 'createdTime',
    customRender: (date) => formatTimestamp(date)
  },
  {
    title: '备注',
    dataIndex: 'remark'
  }
]
